var c = document.getElementById('c'),
    ctx = c.getContext('2d'),
    img = document.getElementById('curImg'),
    imageData;

img.onload = function() {
    c.width = this.width;
    c.height = this.height;
    ctx.drawImage(this, 0, 0);
    currentPixel();
}

//获取当前像素信息
function currentPixel() {
    imageData = ctx.getImageData(0, 0, c.width, c.height); //必须在服务器环境下
    console.log(imageData);
}